import { roleAttacker } from "../role/attacker"
import { roleRangedAttacker } from "../role/ranged_attacker"
import { roleHealer } from "../role/healer"
import { jobSpread } from "../job/spread"

export const classDefender={
    run:function(creep){
        // let targets=creep.room.find(FIND_HOSTILE_CREEPS);
        let ret = OK;
        switch(creep.memory.role){
            case 'ranged_attacker':
                ret = roleRangedAttacker.run(creep);
                break;
            case 'healer':
                ret = roleHealer.run(creep);
                break;
            case 'attacker':
                ret = roleAttacker.run(creep);
                break;
        }
        if(ret==ERR_INVALID_TARGET){
            jobSpread.run(creep);
        }
    }
}